package demo1;

/**
 * @Author 12629
 * @Description：
 */

interface Shape {

/*

    int A = 1;
    int B  =2;
    int C = 3;

*/
    void draw();

    /*default public  void test() {
        System.out.println("fdsfa");
    }*/
}
class Rect implements Shape {
    @Override
    public void draw() {
        System.out.println("矩形！");
    }
}
class Flower implements Shape {
    @Override
    public void draw() {
        System.out.println("❀");
    }
}

public class Test {
    public static void drawMap(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        //demo1.Shape shape = new demo1.Shape();
        Shape shape1 = new Rect();
        Shape shape2 = new Flower();

        drawMap(shape1);
        drawMap(shape2);

        System.out.println("=============");

        Shape[] shapes = {new Rect(),new Rect(),new Flower(),new Flower()};

        for (Shape shape :shapes) {
            shape.draw();
        }

    }
}
